// 这个模块主要是获取商品管理的数据的模块
import request from '@/utils/request'

// 获取商品列表接口 /admin/product/baseTrademark/{page}/{limit}
export const reqTradeMark = (page, limit) => request({ url: `/admin/product/baseTrademark/${page}/${limit}`, method: 'get' })

// 修改品牌 PUT /admin/product/baseTrademark/update
// 新增品牌 POST /admin/product/baseTrademark/save
export const reqAddOrUpdataTradeMark = (tradeMark) => {
    // 如果带给服务器数据携带ID就修改
    if (tradeMark.id) {
        return request({ url: '/admin/product/baseTrademark/update', method: "put", data: tradeMark })
    } else {
        return request({ url: '/admin/product/baseTrademark/save', method: "post", data: tradeMark })
    }
}

// 删除品牌的接口 DELETE /admin/product/baseTrademark/remove/{id}
export const reqDeleteTradeMark = (id) => request({ url: `/admin/product/baseTrademark/remove/${id}`, method: "delete" })